<template>
    <el-tabs v-model="activeName" @tab-click="handleClick" v-if="forceUp">
        <el-breadcrumb class="mrbt">
            <el-breadcrumb-item>
                <i class="el-icon-lx-cascades"></i> {{typeList[type]}}
            </el-breadcrumb-item>
        </el-breadcrumb>
        <user-curves></user-curves>
    </el-tabs>
</template>

<script>
    import UserCurves from './components/UserCurves';

    export default {
        name: 'basecharts',
        components: {
            UserCurves
        },
        data() {
            return {
                forceUp: true,
                activeName: 'first',
                type: '001',
                typeList: {
                    "001": '用户曲线',
                    "002": '分享曲线',
                    "003": '精选曲线'
                }
            };
        },
        watch: {
            $route(to, from) {
                console.log('路由变化')
                this.type = this.$route.query.type;
                this.forceUp = false;
                this.$nextTick(() => {
                    this.forceUp = true;
                });

            }
        },
        methods: {
            handleClick(tab, event) {
                console.log(tab, event);
            }
        },
        mounted() {

        },
        created() {
            this.type = this.$route.query.type;
        }
    };
</script>

<style scoped>
    .mrbt {
        margin-bottom: 12px;
    }

</style>
